.role-manager {
  padding: 20px;
  background: #f0f2f5;
  min-height: 100vh;

  .role-manager-card {
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    border: none;

    .card-header {
      display: flex;
      justify-content: space-between;
      align-items: flex-start;
      margin-bottom: 0;

      .header-content {
        h4 {
          margin-bottom: 4px;
        }
      }

      .add-button {
        border-radius: 8px;
        height: 44px;
        padding: 0 24px;
        font-weight: 500;
        box-shadow: 0 2px 8px rgba(24, 144, 255, 0.3);

        &:hover {
          transform: translateY(-1px);
          box-shadow: 0 4px 12px rgba(24, 144, 255, 0.4);
        }
      }
    }
  }

  .role-table {
    .ant-table {
      border-radius: 8px;
      overflow: hidden;

      .ant-table-thead > tr > th {
        background: #fafafa;
        border-bottom: 2px solid #f0f0f0;
        font-weight: 600;
        color: #262626;
        padding: 20px 16px;
      }

      .ant-table-tbody > tr {
        transition: all 0.2s ease;

        &:hover {
          background: #f8f9ff;
          transform: translateY(-1px);
          box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
        }

        > td {
          padding: 20px 16px;
          border-bottom: 1px solid #f5f5f5;
        }
      }
    }

    .role-info-cell {
      .role-avatar-container {
        display: flex;
        align-items: center;

        .role-details {
          flex: 1;

          .role-name {
            display: flex;
            align-items: center;
            margin-bottom: 6px;

            .ant-tag {
              font-size: 10px;
              padding: 2px 6px;
              height: auto;
              line-height: 1.2;
            }
          }

          .role-description {
            max-width: 180px;
          }
        }
      }
    }

    .user-count-cell {
      display: flex;
      align-items: center;
      justify-content: center;
      padding: 8px 12px;
      background: #f6ffed;
      border-radius: 20px;
      border: 1px solid #b7eb8f;
      display: inline-flex;
    }

    .time-cell {
      display: flex;
      align-items: center;
    }

    .action-buttons {
      .ant-btn {
        border-radius: 6px;
        font-weight: 500;
        height: 32px;

        &.ant-btn-primary {
          background: linear-gradient(135deg, #1890ff, #40a9ff);
          border: none;

          &:hover {
            background: linear-gradient(135deg, #40a9ff, #1890ff);
            transform: translateY(-1px);
            box-shadow: 0 4px 12px rgba(24, 144, 255, 0.3);
          }
        }

        &.ant-btn-default {
          border-color: #d9d9d9;

          &:hover {
            border-color: #1890ff;
            color: #1890ff;
          }
        }

        &.ant-btn-dangerous {
          &:hover {
            transform: translateY(-1px);
            box-shadow: 0 4px 12px rgba(255, 77, 79, 0.3);
          }
        }
      }
    }
  }

  .role-modal {
    .modal-title {
      display: flex;
      align-items: center;
      font-size: 16px;
      font-weight: 600;
    }

    .role-form {
      margin-top: 20px;

      .ant-form-item-label > label {
        font-weight: 600;
      }

      .ant-input {
        border-radius: 8px;

        &:focus {
          box-shadow: 0 0 0 2px rgba(24, 144, 255, 0.2);
        }
      }

      .ant-input-affix-wrapper {
        border-radius: 8px;

        &:focus {
          box-shadow: 0 0 0 2px rgba(24, 144, 255, 0.2);
        }
      }
    }
  }

  .menu-modal {
    .modal-title {
      display: flex;
      align-items: center;
      font-size: 16px;
      font-weight: 600;
    }

    .menu-config-content {
      .menu-config-header {
        margin-bottom: 16px;
        padding: 12px 16px;
        background: #f8f9ff;
        border: 1px solid #e6f7ff;
        border-radius: 8px;
      }

      .menu-tree-container {
        border: 1px solid #e8e8e8;
        border-radius: 8px;
        padding: 16px;
        background: #fafafa;
        max-height: 450px;
        overflow-y: auto;

        .menu-tree {
          background: transparent;

          .ant-tree-node-content-wrapper {
            padding: 6px 8px;
            border-radius: 6px;
            transition: all 0.2s ease;

            &:hover {
              background: #e6f7ff;
            }

            .menu-tree-node {
              display: flex;
              align-items: center;
              font-size: 14px;
            }
          }

          .ant-tree-node-selected {
            .ant-tree-node-content-wrapper {
              background: #bae7ff;
            }
          }

          .ant-tree-treenode {
            padding: 2px 0;
          }

          .ant-tree-switcher {
            display: flex;
            align-items: center;
            justify-content: center;
          }

          .ant-tree-checkbox {
            margin-right: 8px;
          }
        }

        &::-webkit-scrollbar {
          width: 6px;
        }

        &::-webkit-scrollbar-track {
          background: #f1f1f1;
          border-radius: 3px;
        }

        &::-webkit-scrollbar-thumb {
          background: #c1c1c1;
          border-radius: 3px;

          &:hover {
            background: #a8a8a8;
          }
        }
      }

      .menu-config-footer {
        margin-top: 16px;
        padding: 12px 16px;
        background: #f6ffed;
        border: 1px solid #b7eb8f;
        border-radius: 8px;
        text-align: center;
      }
    }
  }

  // 响应式设计
  @media (max-width: 768px) {
    padding: 12px;

    .role-manager-card {
      .card-header {
        flex-direction: column;
        align-items: stretch;
        gap: 16px;

        .add-button {
          width: 100%;
        }
      }
    }

    .role-table {
      .ant-table-tbody > tr > td {
        padding: 12px 8px;
      }

      .action-buttons {
        flex-direction: column;
        gap: 4px;

        .ant-btn {
          width: 100%;
        }
      }
    }
  }
}

// 全局Modal样式优化
.ant-modal {
  .ant-modal-header {
    border-radius: 12px 12px 0 0;
    padding: 20px 24px;
    border-bottom: 1px solid #f0f0f0;
  }

  .ant-modal-body {
    padding: 24px;
  }

  .ant-modal-footer {
    border-top: 1px solid #f0f0f0;
    padding: 16px 24px;
    border-radius: 0 0 12px 12px;

    .ant-btn {
      border-radius: 8px;
      font-weight: 500;
      height: 36px;
      padding: 0 20px;
    }
  }
}
